import os
from waf_dynamo import dmsdk_add_files

def options(opt):
    pass

def configure(conf):
    conf.recurse('gamesys')

def build(bld):
    bld.recurse('gamesys')
    bld.install_files('${PREFIX}/lib/python', 'waf_gamesys.py')

    dmsdk_add_files(bld, '${PREFIX}/sdk/include/dmsdk', 'dmsdk')

    if 'android' in bld.env['PLATFORM']:
        classpath = [bld.env.ANDROID_JAR]
        classpath = os.pathsep.join(classpath)

        bld(features='javac seq',
            classpath=classpath,
            outdir='java',
            source_root='java')

        bld.env['JAVACFLAGS'] = '-g -source 1.8 -target 1.8'.split()

        bld(features='jar seq',
            basedir='java',
            destfile='gamesys_android.jar')

        bld.install_files('${PREFIX}/share/java', 'gamesys_android.jar')
